cmake_minimum_required(VERSION 3.5)

add_library(node_base node_base.cpp)
target_link_libraries(node_base ${catkin_LIBRARIES} yaml-cpp)
#######
add_library(node_lateral_speed3dis node_lateral_speed3dis.cpp)
target_link_libraries(node_lateral_speed3dis node_base vehicle_mpc VehicleDyn ${catkin_LIBRARIES} yaml-cpp)

add_library(node_lateral_speed node_lateral_speed.cpp)
target_link_libraries(node_lateral_speed node_base vehicle_mpc VehicleDyn ${catkin_LIBRARIES} yaml-cpp)

add_library(node_lateral_speed_yaw node_lateral_speed_yaw.cpp)
target_link_libraries(node_lateral_speed_yaw node_base vehicle_mpc VehicleDyn ${catkin_LIBRARIES} yaml-cpp)

add_library(node_vy_yaw_error3dis node_vy_yaw_error3dis.cpp)
target_link_libraries(node_vy_yaw_error3dis node_base vehicle_mpc VehicleDyn ${catkin_LIBRARIES} yaml-cpp)

add_library(node_ll node_ll.cpp)
target_link_libraries(node_ll node_base vehicle_mpc VehicleDyn ${catkin_LIBRARIES} yaml-cpp)
add_library(node_ll_4d4s node_ll_4d4s.cpp)
target_link_libraries(node_ll_4d4s node_base vehicle_mpc VehicleDyn ${catkin_LIBRARIES} yaml-cpp)
#######

add_library(ctr_node INTERFACE)
target_link_libraries(ctr_node INTERFACE
						node_base
						node_lateral_speed3dis
						node_lateral_speed
						node_lateral_speed_yaw
						node_vy_yaw_error3dis
						node_ll
						node_ll_4d4s
		)

add_executable(main_ctr main_ctr.cpp)
target_link_libraries(main_ctr ctr_node ${catkin_LIBRARIES} yaml-cpp)